package com.buer.storage.controller;


import com.buer.storage.dto.SelectStockDto;
import com.buer.storage.service.StockService;
import com.buer.storage.utils.DateUtils;
import com.buer.storage.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.*;

@RestController
@RequestMapping("/Stock")
public class StockController {
    @Resource
    private StockService stockService;

    @GetMapping("/selectNumByDate")
    public R selectNumByDate(){
        List<Map> list = stockService.selectNumByDate();
        return R.setR(1,"OK",list);
    }

    @GetMapping("/selectStockNumSum")
    public List<SelectStockDto> selectStockNumSum(){
        List<SelectStockDto> selectStockDtos = stockService.selectStockNumSum();
        return selectStockDtos;
    }

    @GetMapping("/selectNumByName")
    public R selectNumByName(){
        List<Map> list = stockService.selectNumByName();
        return R.setR(1,"OK",list);
    }
}
